import { Component, OnInit } from '@angular/core';

import {  BehaviorSubject } from '@ds/ds-micro/dist';

@Component({
  selector: 'app-customer-detail',
  templateUrl: './customer-detail.component.html',
  styleUrls: ['./customer-detail.component.less']
})
export class CustomerDetailComponent implements OnInit {
  
  i = 1;
  data = new BehaviorSubject<{}>();

  constructor() { }

  ngOnInit(): void {
    this.data.subscribe(v => {
      // console.log('customer内部变化:', v, this.i);
      this.i = v?.data;
    })
  
  }

  ngDoCheck(): void {
    //Called every time that the input properties of a component or a directive are checked. Use it to extend change detection by performing a custom check.
    //Add 'implements DoCheck' to the class.
    console.log('------------------跑了吗')
  }

  iChange(ev) {
    console.log('-----------------', ev)
    this.data.next({data: ev})
  }

}
